FROM openjdk:8-alpine

ADD target/db2doc.jar /opt

ADD db2doc.sh /opt

WORKDIR /opt

ENV DB_NAME demo
ENV DATA_DIR /opt/data/
ENV DOC_TYPE html
ENV IGNORE_TABLE_NAME ''
ENV IGNORE_PREFIX ''
ENV IGNORE_SUFFIX ''
ENV JVM_OPTS ''

RUN mkdir $DATA_DIR

VOLUME $DATA_DIR

ENTRYPOINT java ${JVM_OPTS} -jar ./db2doc.jar


# arm64v8
# docker build . -t pi4k8s/db2doc:1.0-arm64 && docker push pi4k8s/db2doc:1.0-arm64

# x86
# docker build . -t pi4k8s/db2doc:1.0-amd64 && docker push pi4k8s/db2doc:1.0-amd64


# manifest
# docker manifest create pi4k8s/db2doc:1.0 pi4k8s/db2doc:1.0-arm64 pi4k8s/db2doc:1.0-amd64
# docker manifest annotate pi4k8s/db2doc:1.0 pi4k8s/db2doc:1.0-amd64 --os linux --arch amd64
# docker manifest annotate pi4k8s/db2doc:1.0 pi4k8s/db2doc:1.0-arm64 --os linux --arch arm64
# docker manifest push pi4k8s/db2doc:1.0

